package com.hushao.lims.weblims.service;

import com.hushao.lims.weblims.domain.EquipmentStorage;
import com.hushao.lims.weblims.domain.TeacherInfo;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;

/**
 * @author 930588706
 * @date 18/1/22
 * 器材入库
 */
public interface EquipmentStorageService {
    /**
     * 根据器材名称模糊查询个人器材入库(分页)
     * @param equipmentName
     * @param teacher
     * @param pageable
     * @return
     */
   Page<EquipmentStorage> listEquipmentStorageByTeacherAndEquipmentName(String equipmentName, TeacherInfo teacher, Pageable pageable);

    /**
     * 器材入库
     * @param equipmentStorage
     * @return
     * @throws Exception
     */
    EquipmentStorage saveEquipmentStorage(EquipmentStorage equipmentStorage) throws Exception;

    /**
     * 撤销待审核的器材入库（删除）
     * @param equipmentStorageId
     * @throws Exception
     */
    void remove(Long equipmentStorageId)throws Exception;

    /**
     * 根据器材名称，状态模糊查询器材入库
     * @param equipmentName
     * @param state
     * @param pageable
     * @return
     */

    Page<EquipmentStorage> listEquipmentStorageByEquipmentNameLikeAndStateLike(String equipmentName, String state, Pageable pageable);

    /**
     * 审核器材入库
     * @param equipmentStorageId
     * @param state
     * @param teacher
     * @return
     * @throws Exception
     */
    EquipmentStorage audit(Long equipmentStorageId, String state, TeacherInfo teacher)throws Exception;

    /**
     * 完成已通过的器材入库
     * @param equipmentStorageId
     * @return
     * @throws Exception
     */
    EquipmentStorage achieve(Long equipmentStorageId)throws Exception;
}
